import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    albumDetailList: {},
    albumSongList: {},
    //音乐播放链接
    musicURL: '',
    //歌曲名字
    musicName: '',
    //歌词
    musicLyric: [],
    //歌曲时间数组
    musicTime: []
  },
  mutations: {
    SET_ALBUM_DETAIL(state, obj){
      state.albumDetailList = obj
    },
    SET_ALBUM_SONG(state,song) {
      state.albumSongList = song
    },
    SET_MUSIC_URL(state, url){
      state.musicURL = url
    },
    SET_MUSIC_NAME(state, name){
      state.musicName = name
    },
    SET_MUSIC_LYRIC(state, lyric){
      state.musicLyric = lyric
    },
    SET_MUSIC_TIME(state, time){
      state.musicTime = time
    }
  },
  getters: {
    GET_ALBUM_DETAIL(state){
      return state.albumDetailList
    },
    GET_ALBUM_SONG(state) {
      return state.albumSongList
    },
    GET_MUSIC_URL(state){
      return state.musicURL
    },
    GET_MUSIC_NAME(state, url){
      return state.musicName
    },
    GET_MUSIC_LYRIC(state, lyric){
      return state.musicLyric
    },
    GET_MUSIC_TIME(state, time){
      return state.musicTime
    },
  },
  actions: {
  },
  modules: {
  }
})
